package com.haoan.index.common.enums;

import lombok.Getter;

/**
 * 用户登录渠道
 *
 * @author kwj
 */
@Getter
public enum UserSource {
    WX("1", "微信小程序用户", "微信小程序用户"),
    //ZFB("2", "支付宝小程序用户", "支付宝小程序用户"),
    NOT_FOUND("", "NULL", "NULL");
    private final String code;
    private final String name;
    private final String remark;

    UserSource(String code, String name, String remark) {
        this.code = code;
        this.name = name;
        this.remark = remark;
    }

    public static UserSource getByCode(String code) {
        for (UserSource demoEnum : UserSource.values()) {
            if (demoEnum.getCode().equals(code)) {
                return demoEnum;
            }
        }
        return NOT_FOUND;
    }

}
